<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>柱状图：series type=bar</title>
  <script src="./echarts.js"></script>
  <script src="./data/AQIData.js"></script>
  <style lang="css">
    #chart1, #chart2 {
      width: 1000px;
      height: 668px;
      border: 1px solid red;
      float: left;
    }
  </style>
</head>
<body>
  <div id="chart1"></div>

  <script>
    const myChart1 = echarts.init(document.getElementById('chart1'));

    myChart1.setOption({
      title: {
        text: 'BeiJing AQI',
      },
      legend: {},
      tooltip: {
        trigger: 'axis', // 折线图要修改触发方式
      },
      xAxis: {
        data: ['篮球', '足球', '排球', '网球'],
        axisTick: {
          show: false,
        }
      },
      yAxis: {
        splitLine: false,
      },
      series: [
        {
          name: '昨日销量',
          type: 'bar',
          data: [60, 40, 72, 33],
          legendHoverLink: false,
          coordinateSystem: 'cartesian2d',
          label: {
            show: true,
            position: 'top',
          },
          itemStyle: {
            color: 'green',
          },
          emphasis: {
            label: {
              fontSize: 20,
            },
            itemStyle: {
              color: 'green',
              opacity: 0.5
            },
          },
          // barWidth: 30,
          // barMaxWidth: 80,
          // barGap: '-100%',
          // barCategoryGap: '50%',
        },
        {
          name: '今日销量',
          type: 'bar',
          data: [45, 60, 13, 25]
        },
      ],
    })
  </script>
</body>
</html>